<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title><?php echo $site_title;?></title>
		<link type="text/css" href="<?php echo base_url(); ?>resources/style/admin/login.css" rel="stylesheet" />
		<script type="text/javascript" src="<?php echo base_url();?>resources/js/jquery-1.4.2.js"></script>
		<script type="text/javascript">
		//去左空格;
		function ltrim(s)
		{
		    return s.replace(/(^\s*)/g, "");
		}
		//去右空格;
		function rtrim(s)
		{
		    return s.replace(/(\s*$)/g, "");
		}
		//去左右空格;
		function trim(s)
		{
		    //s.replace(/(^\s*)|(\s*$)/g, "");
		    return rtrim(ltrim(s));
		}
		function chkLogin(frm)
		{
			var username = trim(frm.username.value);
			var passwd = trim(frm.passwd.value);
			var validate = trim(frm.validate.value);
			if(username == '')
			{
				$('#msg').html('请输入帐号/邮箱');
				frm.username.focus();
				return false;
			}
			if(passwd  == '')
			{
				$('#msg').html('请输入密码');
				frm.passwd.focus();
				return false;
			}
			if( passwd.length < 6)
			{
				$('#msg').html('请输入6位以上的密码');
				frm.passwd.focus();
				return false;
			}
			 if(validate.length < 4)
			{
				$('#msg').html('请输入验证码');
				frm.validate.focus();
				return false;
			}
			return true;
		}
		$(document).ready(function(){
		  $("#username").focus();
		})
		</script>
	</head>
	<body>
		<div id="background">
			<div id="container">
				<div id="logo">
				</div>
				<div id="box">
					<div id="logonbox_tit">登 录
					</div>
					<form action="" method="POST"  onsubmit="return chkLogin(this);">
						<div class="one_half" style="color:red;" id="msg"><?php echo $error;?></div>
						<div class="one_half">
							<p>帐&nbsp;&nbsp;号：<input id="username" name="username" value="" class="field" autocomplete='off'/></p>
							<p>密&nbsp;&nbsp;码：<input type="password" name="passwd" value="" class="field"  autocomplete='off' >	</p>
						</div>
						<div class="one_half last">
							<p>验证码：<input type="text" name="validate" value="" class="verify" maxlength="4" autocomplete="off">
								<img src="<?php  echo base_url().'index.php/verify/';?>" style="cursor:pointer;" title="点击图片刷新" onclick="this.src='<?php echo base_url().'index.php/verify?'.rand();?>'" border="0" align='absmiddle'/>
							</p>
							<p><input type="submit" value="进入" class="login" name="logon" /></p>
						</div>
				</form> 
			</div> 
			
			</div>
	</div>
	</body>
</html>
